package top.oylan.manager.service;

import top.oylan.manager.entity.Category;
import top.oylan.manager.entity.extend.CategoryExtend;
import top.oylan.manager.entity.TypeCategory;
import top.oylan.manager.entity.example.CategoryExample;
import top.oylan.manager.tools.Pager;
import top.oylan.manager.tools.enums.Types;

import java.util.List;

/**
 * @Author abduahad
 * @Description ${description}
 * @Date 2019-02-12
 */
public interface CategoryService {

    List<CategoryExtend> selectCategoryByPage(Pager<CategoryExtend> page);

    List<Category> selectByExample(Category category);

    List<Category> selectByExample(CategoryExample example);

    CategoryExtend selectCategoryById(Integer id);

    void saveCategory(Category category, int [] types) throws Exception;

    void updateCategory(Category category, int [] types) throws Exception;

    int delete(Integer id);

    List<TypeCategory> selectCategoryType(Integer id);

    List<Category> selectCategoriesForProduct(Types type);

    List<Short> categoryTree(List<Category> list, List<Short> result, int cateId);

    // for-api
    List<Category> selectCategoryByType(int typeId);
}
